(function(c,b,a,d){c.fn.kkstarratings=function(e){c.fn.kkstarratings.options=c.extend({ajaxurl:null,nonce:null,func:null,grs:false,msg:"Rate this post",fuelspeed:400,thankyou:"Thank you for rating.",error_msg:"An error occured.",tooltip:true,tooltips:{0:{tip:"Poor",color:"red"},1:{tip:"Fair",color:"brown"},2:{tip:"Average",color:"orange"},3:{tip:"Good",color:"blue"},4:{tip:"Excellent",color:"green"}}},c.fn.kkstarratings.options,e?e:{});var f=[];this.each(function(){f.push(c(this))});c.fn.kkstarratings.fetch(f,0,"0%",c.fn.kkstarratings.options.msg,true);return this.each(function(){})};c.fn.kkstarratings.animate=function(g){if(!g.hasClass("disabled")){var f=c(".kksr-legend",g).html(),e=c(".kksr-fuel",g).css("width");c(".kksr-stars a",g).hover(function(){var h=c(this).attr("href").split("#")[1];if(c.fn.kkstarratings.options.tooltip!=0){if(c.fn.kkstarratings.options.tooltips[h-1]!=null){c(".kksr-legend",g).html(''+c.fn.kkstarratings.options.tooltips[h-1].tip+"")}else{c(".kksr-legend",g).html(f)}}c(".kksr-fuel",g).stop(true,true).css("width","0%");c(".kksr-stars a",g).each(function(j,k){var i=c(this),l=i.attr("href").split("#")[1];if(parseInt(l)<=parseInt(h)){c(".kksr-stars a",g).stop(true,true);i.hide().addClass("kksr-star").addClass("orange").fadeIn("fast")}})},function(){c(".kksr-stars a",g).removeClass("kksr-star").removeClass("orange");if(c.fn.kkstarratings.options.tooltip!=0){c(".kksr-legend",g).html(f)}c(".kksr-fuel",g).stop(true,true).animate({width:e},c.fn.kkstarratings.options.fuelspeed)}).unbind("click").click(function(){return c.fn.kkstarratings.click(g,c(this).attr("href").split("#")[1])})}else{c(".kksr-stars a",g).unbind("click").click(function(){return false})}};c.fn.kkstarratings.update=function(h,e,g,f,i){if(f=="true"){c(".kksr-fuel",h).removeClass("yellow").addClass("orange")}c(".kksr-fuel",h).stop(true,true).animate({width:e},c.fn.kkstarratings.options.fuelspeed,"linear",function(){if(f=="true"){h.addClass("disabled");c(".kksr-stars a",h).unbind("hover")}if(!c.fn.kkstarratings.options.grs||!i){c(".kksr-legend",h).stop(true,true).hide().html(g?g:c.fn.kkstarratings.options.msg).fadeIn("slow",function(){c.fn.kkstarratings.animate(h)})}else{c.fn.kkstarratings.animate(h)}})};c.fn.kkstarratings.click=function(h,e){c(".kksr-stars a",h).unbind("hover").unbind("click").removeClass("kksr-star").removeClass("orange").click(function(){return false});var g=c(".kksr-legend",h).html(),f=c(".kksr-fuel",h).css("width");c.fn.kkstarratings.fetch(h,e,f,g,false);return false};c.fn.kkstarratings.fetch=function(g,e,i,h,j){var f=[];c.each(g,function(){f.push(c(this).attr("data-id"))});c.ajax({url:c.fn.kkstarratings.options.ajaxurl,data:"action="+c.fn.kkstarratings.options.func+"&id="+f+"&stars="+e+"&_wpnonce="+c.fn.kkstarratings.options.nonce,type:"post",dataType:"json",beforeSend:function(){c(".kksr-fuel",g).animate({width:"0%"},c.fn.kkstarratings.options.fuelspeed);if(e){c(".kksr-legend",g).fadeOut("fast",function(){c(".kksr-legend",g).html(''+c.fn.kkstarratings.options.thankyou+"")}).fadeIn("slow")}},success:function(k){c.each(g,function(){var m=c(this),l=m.attr("data-id");if(k[l].success){c.fn.kkstarratings.update(m,k[l].fuel+"%",k[l].legend,k[l].disable,j)}else{c.fn.kkstarratings.update(m,i,h,false,j)}})},complete:function(){},error:function(k){c(".kksr-legend",g).fadeOut("fast",function(){c(".kksr-legend",g).html(''+c.fn.kkstarratings.options.error_msg+"")}).fadeIn("slow",function(){c.fn.kkstarratings.update(g,i,h,false,j)})}})};c.fn.kkstarratings.options={ajaxurl:bhittani_plugin_kksr_js.ajaxurl,func:bhittani_plugin_kksr_js.func,nonce:bhittani_plugin_kksr_js.nonce,grs:bhittani_plugin_kksr_js.grs,tooltip:bhittani_plugin_kksr_js.tooltip,tooltips:bhittani_plugin_kksr_js.tooltips,msg:bhittani_plugin_kksr_js.msg,fuelspeed:bhittani_plugin_kksr_js.fuelspeed,thankyou:bhittani_plugin_kksr_js.thankyou,error_msg:bhittani_plugin_kksr_js.error_msg}})(jQuery,window,document);jQuery(document).ready(function(a){a(".kk-star-ratings").kkstarratings()});
var woodiscuzValidator=(function($){
var message, tests, checkField, validate, mark, unmark, field, minmax, defaults,
validateWords, lengthRange, lengthLimit, pattern, alertTxt, data,
email_illegalChars=/[\(\)\<\>\,\;\:\\\/\"\[\]]/,
email_filter=/^.+@.+\..{2,50}$/;
message={
invalid: 'invalid input',
empty: 'please put something here',
min: 'input is too short',
max: 'input is too long',
number_min: 'too low',
number_max: 'too high',
url: 'invalid URL',
number: 'not a number',
email: 'email address is invalid',
email_repeat: 'emails do not match',
password_repeat: 'passwords do not match',
repeat: 'no match',
complete: 'input is not complete',
select: 'Please select an option'
};
if(!window.console){
console={};
console.log=console.warn=function(){
return;
}}
defaults={alerts: true};
tests={
sameAsPlaceholder: function(a){
return $.fn.placeholder&&a.attr('placeholder')!==undefined&&data.val==a.prop('placeholder');
},
hasValue: function(a){
if(!a){
alertTxt=message.empty;
return false;
}
return true;
},
linked: function(a, b){
if(b!=a){
alertTxt=message[data.type + '_repeat']||message.no_match;
return false;
}
return true;
},
email: function(a){
if(!email_filter.test(a)||a.match(email_illegalChars)){
alertTxt=a ? message.email:message.empty;
return false;
}
return true;
},
text: function(a){
if(validateWords){
var words=a.split(' ');
var wordsLength=function(len){
for (var w=words.length; w--;)
if(words[w].length < len)
return false;
return true;
};
if(words.length < validateWords||!wordsLength(2)){
alertTxt=message.complete;
return false;
}
return true;
}
if(lengthRange&&a.length < lengthRange[0]){
alertTxt=message.min;
return false;
}
if(lengthRange&&lengthRange[1]&&a.length > lengthRange[1]){
alertTxt=message.max;
return false;
}
if(lengthLimit&&lengthLimit.length){
var obeyLimit=false;
while (lengthLimit.length){
if(lengthLimit.pop()==a.length)
obeyLimit=true;
}
if(!obeyLimit){
alertTxt=message.complete;
return false;
}}
if(pattern){
var regex, jsRegex;
switch (pattern){
case 'alphanumeric' :
regex=/^[a-z0-9]+$/i;
break;
case 'numeric' :
regex=/^[0-9]+$/i;
break;
case 'phone' :
regex=/^\+?([0-9]|[-|' '])+$/i;
break;
default :
regex=pattern;
}
try {
jsRegex=new RegExp(regex).test(a);
if(a&&!jsRegex)
return false;
}
catch (err){
console.log(err, field, 'regex is invalid');
return false;
}}
return true;
},
number: function(a){
if(isNaN(parseFloat(a))&&!isFinite(a)){
alertTxt=message.number;
return false;
}
else if(lengthRange&&a.length < lengthRange[0]){
alertTxt=message.min;
return false;
}
else if(lengthRange&&lengthRange[1]&&a.length > lengthRange[1]){
alertTxt=message.max;
return false;
}
else if(minmax[0]&&(a | 0) < minmax[0]){
alertTxt=message.number_min;
return false;
}
else if(minmax[1]&&(a | 0) > minmax[1]){
alertTxt=message.number_max;
return false;
}
return true;
},
date: function(a){
var day, A=a.split(/[-./]/g), i;
if(field[0].valueAsNumber)
return true;
for (i=A.length; i--;){
if(isNaN(parseFloat(a))&&!isFinite(a))
return false;
}
try {
day=new Date(A[2], A[1] - 1, A[0]);
if(day.getMonth() + 1==A[1]&&day.getDate()==A[0])
return day;
return false;
}
catch (er){
console.log('date test: ', err);
return false;
}},
url: function(a){
function testUrl(url){
return /^(https?:\/\/)?([\w\d\-_]+\.+[A-Za-z]{2,})+\/?/.test(url);
}
if(!testUrl(a)){
console.log(a);
alertTxt=a ? message.url:message.empty;
return false;
}
return true;
},
hidden: function(a){
if(lengthRange&&a.length < lengthRange[0]){
alertTxt=message.min;
return false;
}
if(pattern){
var regex;
if(pattern=='alphanumeric'){
regex=/^[a-z0-9]+$/i;
if(!regex.test(a)){
return false;
}}
}
return true;
},
select: function(a){
if(!tests.hasValue(a)){
alertTxt=message.select;
return false;
}
return true;
}};
mark=function(field, text){
if(!text||!field||!field.length)
return false;
var item=field.parents('.woodiscuz-item'),
warning;
if(item.hasClass('bad')){
if(defaults.alerts)
item.find('.alert').html(text);
}
else if(defaults.alerts){
warning=$('
').html(text);
item.append(warning);
}
item.removeClass('bad');
setTimeout(function(){
item.addClass('bad');
}, 0);
};
unmark=function(field){
if(!field||!field.length){
console.warn('no "field" argument, null or DOM object not found');
return false;
}
field.parents('.woodiscuz-item')
.removeClass('bad')
.find('.alert').remove();
};
function testByType(type, value){
if(type=='tel')
pattern=pattern||'phone';
if(!type||type=='password'||type=='tel')
type='text';
return tests[type](value);
}
function prepareFieldData(el){
field=$(el);
field.data('valid', true);
field.data('type', field.attr('type'));
pattern=field.attr('pattern');
}
function keypress(e){
prepareFieldData(this);
if(e.charCode)
return testByType(this.type, String.fromCharCode(e.charCode));
}
function checkField(){
if(this.type!='hidden'&&$(this).is(':hidden'))
return true;
prepareFieldData(this);
field.data('val', field[0].value.replace(/^\s+|\s+$/g, ""));
data=field.data();
alertTxt=message[field.prop('name')]||message.invalid;
if(field[0].nodeName.toLowerCase()==="select"){
data.type='select';
}
if(field[0].nodeName.toLowerCase()==="textarea"){
data.type='text';
}
validateWords=data['validateWords']||0;
lengthRange=data['validateLengthRange'] ? (data['validateLengthRange'] + '').split(','):[1];
lengthLimit=data['validateLength'] ? (data['validateLength'] + '').split(','):false;
minmax=data['validateMinmax'] ? (data['validateMinmax'] + '').split(','):'';
data.valid=tests.hasValue(data.val);
if(data.valid){
if(tests.sameAsPlaceholder(field)){
alertTxt=message.empty;
data.valid=false;
}
if(data.validateLinked){
var linkedTo=data['validateLinked'].indexOf('#')==0 ? $(data['validateLinked']):$(':input[name=' + data['validateLinked'] + ']');
data.valid=tests.linked(data.val, linkedTo.val());
}
else if(data.valid||data.type=='select')
data.valid=testByType(data.type, data.val);
if(field.hasClass('optional')&&!data.val)
data.valid=true;
}
if(data.valid)
unmark(field);
else {
mark(field, alertTxt);
submit=false;
}
return data.valid;
}
function checkAll($form){
$form=$($form);
if($form.length==0){
console.warn('element not found');
return false;
}
var that=this,
submit=true,
fieldsToCheck=$form.find(':input').filter('[required=required], .required, .optional').not('[disabled=disabled]');
fieldsToCheck.each(function(){
submit=submit * checkField.apply(this);
});
return !!submit;
}
return {
defaults: defaults,
checkField: checkField,
keypress: keypress,
checkAll: checkAll,
mark: mark,
unmark: unmark,
message: message,
tests: tests
}})(jQuery);
jQuery(document).ready(function ($){
var wpc_home_url=$('#wpc_home_url').val();
var wpc_plugin_dir_url=$('#wpc_plugin_dir_url').val();
var wpc_name;
var wpc_email;
var wpc_comment;
var wpc_captcha;
var wpc_comment_post_ID;
var wpc_comment_parent;
var wpc_form;
var wpc_submitID;
var wpc_comments_offset;
var wpc_new_comment_id;
var wpc_loading_image;
var wpc_comment_text_before_editting;
$(".wpc_comment").autoGrow();
$(document).on('click', '#wpc_openModalFormAction', function (){
$('#wpc_openModalFormAction').css('opacity', '0');
$('#wpc_openModalFormAction').css('pointer-events', 'none');
});
$(document).on('click', '#wpc_openModalFormAction .close', function (){
$('#wpc_openModalFormAction').css('opacity', '0');
$('#wpc_openModalFormAction').css('pointer-events', 'none');
});
wpc_loading_image="
";
wpc_comments_offset=$('#wpc_comments_offset');
wpc_comments_offset.val('1');
$(document).on('focus', '.wpc_comment', function (){
var uniqueID=getUniqueID($(this));
$('#wpc-form-footer-' + uniqueID).slideDown(700);
});
$(document).on('click', '.wpc-reply-link', function (){
var uniqueID=getUniqueID($(this));
$('#wpc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
});
$(document).on('click', '.wpc-share-link', function (){
var uniqueID=getUniqueID($(this));
$('#share_buttons_box-' + uniqueID).slideToggle(1000);
});
$(document).on('click', '.wpc_captcha_refresh_img', function (){
var uniqueID=getUniqueID($(this));
var wpc_commpost_ID=$('#wpc_comment_post_ID-' + uniqueID).val();
var wpc_commparent=$('#wpc_comment_parent-' + uniqueID).val();
$("#wpc_captcha_img-" + uniqueID).attr("src", wpc_home_url + "/" + wpc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wpc_commpost_ID + '-' + wpc_commparent + '&r=' + Math.random());
});
$(document).on('click', '.wpc_comm_submit', function (){
wpc_submitID=$(this).attr('id');
var uniqueID=wpc_submitID.substring(wpc_submitID.lastIndexOf('-') + 1);
wpc_name=$('#wpc_name-' + uniqueID).val();
wpc_email=$('#wpc_email-' + uniqueID).val();
wpc_comment=$('textarea#wpc_comment-' + uniqueID).val();
wpc_captcha=$('#wpc_captcha-' + uniqueID).val();
wpc_comment_post_ID=$('#wpc_comment_post_ID-' + uniqueID).val();
wpc_comment_parent=$('#wpc_comment_parent-' + uniqueID).val();
wpc_form=$('#wpc_comm_form-' + uniqueID);
var depth='';
if(isMainFormSubmit(wpc_submitID, wpc_comment_post_ID)){
depth=1;
}else{
depth=getCommentDepth($(this).parents('.wpc-comment'));
}
var submit=true;
if(!woodiscuzValidator.checkAll(wpc_form)){
submit=false;
$('#wpc_captcha-' + uniqueID).val('');
$("#wpc_captcha_img-" + uniqueID).attr("src", wpc_home_url + "/" + wpc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wpc_comment_post_ID + '-' + wpc_comment_parent + '&r=' + Math.random());
}else{
$('#wpc_openModalFormAction .close').css('display', 'none');
$('#wpc_openModalFormAction').css('opacity', '1');
$('#wpc_openModalFormAction').css('pointer-events', 'auto');
$('#wpc_openModalFormAction > #wpc_response_info').html(wpc_loading_image);
}
var notification_type='';
var notification_type_radio=$("input[name='wpc_notification_new_reply-" + uniqueID + "']:checked").length ? $("input[name='wpc_notification_new_reply-" + uniqueID + "']:checked").val():'';
if(notification_type_radio.length){
if(notification_type_radio=='wpc_notification_new_reply'){
notification_type='reply';
}}
if(submit){
$.ajax({
type: 'POST',
url: wpc_ajax_obj.url,
data: {
name: wpc_name,
email: wpc_email,
comment: wpc_comment,
captcha: wpc_captcha,
comment_depth: depth,
comment_post_ID: wpc_comment_post_ID,
comment_parent: wpc_comment_parent,
notification_type: notification_type,
action: 'wpc_comms_via_ajax'
}}).done(function (response){
$("#wpc_captcha_img-" + uniqueID).attr("src", wpc_home_url + "/" + wpc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wpc_comment_post_ID + '-' + wpc_comment_parent + '&r=' + Math.random());
var obj=$.parseJSON(response);
wpc_new_comment_id=parseInt(obj.wpc_new_comment_id);
if(obj.code===-1){
$('#wpc_response_info').html(obj.message);
}else if(obj.code===-2){
var html="
";
$('#wpc_response_info').html(html + obj.message);
$('#wpc_openModalFormAction .close').css('display', 'block');
$('#wpc_comment-' + uniqueID).val('');
$('.wpc_comm_form textarea').css('height', '46px');
if(wpc_submitID==='wpc_comm-' + wpc_comment_post_ID + '_0'){
$('#wpc-form-footer-' + uniqueID).slideToggle(700);
}else{
$('#wpc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
}
$.cookie('wpc_author_name', wpc_name);
$.cookie('wpc_author_email', wpc_email);
$.cookie('wpc_poster', wpc_email, 60 * 60 * 24 * 365 * 10);
}else{
$('#wpc_comment-' + uniqueID).val('');
$('.wpc_comm_form textarea').css('height', '46px');
if(wpc_submitID==='wpc_comm-' + wpc_comment_post_ID + '_0'){
$('.wpc-thread-wrapper').prepend(obj.message);
$('#wpc-form-footer-' + uniqueID).slideToggle(700);
}else{
$('#wpc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
if(obj.is_in_same_container==1){
$('#wpc-secondary-forms-wrapper-' + uniqueID).after(obj.message);
}else{
$('#wpc-secondary-forms-wrapper-' + uniqueID).after(obj.message.replace('wpc-reply', 'wpc-reply wpc-no-left-margin'));
}}
$('#wpc_openModalFormAction').css('opacity', '0');
$('#wpc_openModalFormAction').css('pointer-events', 'none');
if(wpc_name!==''&&wpc_email!==''){
$.cookie('wpc_author_name', wpc_name);
$.cookie('wpc_author_email', wpc_email);
$('#woopcomm .wpc_name').val(wpc_name);
$('#woopcomm .wpc_email').val(wpc_email);
}
$.cookie('wpc_poster', wpc_email, 60 * 60 * 24 * 365 * 10);
if(wpc_new_comment_id!==-1){
notify_on_new_comment(wpc_comment_post_ID, wpc_new_comment_id, wpc_email);
}}
$('#wpc_captcha-' + uniqueID).val('');
$('.wpc_tooltipster').tooltipster({offsetY: 2,multiple:true});
$('.wpc_comm_form input').css('box-shadow', '0 0 4px -2px #d4d0ba');
$('.wpc_comm_form textarea').css('box-shadow', '0 0 4px -2px #d4d0ba');
if((obj.code==1||obj.code==-2)&&$('form.wpc_main_form').hasClass('wpc-no-comments')){
$.ajax({
type: 'POST',
url: wpc_ajax_obj.url,
data: {
wpc_new_comment_id: wpc_new_comment_id,
action: 'woodiscuz_comment_redirect'
}}).done(function (redirectResponse){
try {
var redirectObj=$.parseJSON(redirectResponse);
if(redirectObj.code==1){
setTimeout(function (){
window.location.href=redirectObj.redirect_to;
}, 5000)
}} catch (e){
}});
}});
}else{
return false;
}});
$(document).on('click', '.wpc_vote', function (){
var uniqueID=getUniqueID($(this));
var commentID=getCommentID(uniqueID);
var voteType;
$('#wpc_openModalFormAction > #wpc_response_info').html(wpc_loading_image);
$('#wpc_openModalFormAction .close').css('display', 'block');
$('#wpc_openModalFormAction').css('opacity', '1');
$('#wpc_openModalFormAction').css('pointer-events', 'auto');
if($(this).hasClass('wpc-up')){
voteType=1;
}else{
voteType=-1;
}
$.ajax({
dateType: 'json',
type: 'POST',
url: wpc_ajax_obj.url,
data: {
comment_ID: commentID,
vote_type: voteType,
action: 'wpc_vote_via_ajax'
}}).done(function (response){
var obj=$.parseJSON(response);
if(obj.code!==-1){
$('#vote-count-' + uniqueID).text(parseInt($('#vote-count-' + uniqueID).text()) + voteType);
$('#wpc_openModalFormAction').css('opacity', '0');
$('#wpc_openModalFormAction').css('pointer-events', 'none');
}else{
var html="
";
$('#wpc_response_info').html(html + obj.message);
$('#wpc_openModalFormAction .close').css('display', 'block');
}});
});
$(document).on('click', '.wpc-load-more-submit', function (){
$('#wpc_openModalFormAction > #wpc_response_info').html(wpc_loading_image);
$('#wpc_openModalFormAction .close').css('display', 'none');
$('#wpc_openModalFormAction').css('opacity', '1');
$('#wpc_openModalFormAction').css('pointer-events', 'auto');
var wpc_comments_offset_value=wpc_comments_offset.val();
var wpc_post_id=getPostID($(this).attr('id'));
var wpc_parent_comments_count=parseInt($('#wpc_parent_comments_count').val());
var wpc_parent_per_page=parseInt($('#wpc_parent_per_page').val());
wpc_comments_offset_value=parseInt(wpc_comments_offset_value);
wpc_comments_offset_value++;
$.ajax({
type: 'POST',
url: wpc_ajax_obj.url,
data: {
comments_offset: wpc_comments_offset_value,
wpc_post_id: wpc_post_id,
action: 'wpc_load_more_comments'
}}).done(function (response){
wpc_comments_offset.val(wpc_comments_offset_value);
if(wpc_parent_comments_count <=(wpc_comments_offset_value * wpc_parent_per_page)){
$('.wpc-load-more-submit-wrap').remove();
}
$('.wpc-thread-wrapper').html(response);
$('#wpc_openModalFormAction').css('opacity', '0');
$('#wpc_openModalFormAction').css('pointer-events', 'none');
$('.wpc_tooltipster').tooltipster({offsetY: 2});
});
});
function getUniqueID(field){
var fieldID=field.attr('id');
var uniqueID=fieldID.substring(fieldID.lastIndexOf('-') + 1);
return uniqueID;
}
function getPostID(uniqueID){
var postID=uniqueID.substring(uniqueID.lastIndexOf('-') + 1);
postID=postID.substring(0, postID.lastIndexOf('_'));
return postID;
}
function getCommentID(uniqueID){
var commentID=uniqueID.substring(uniqueID.indexOf('_') + 1);
return commentID;
}
function notify_on_new_comment(post_id, comment_id, email){
$.ajax({
type: 'POST',
url: wpc_ajax_obj.url,
data: {
wpc_post_id: post_id,
wpc_comment_id: comment_id,
wpc_email: email,
action: 'wpc_check_notification_type'
}});
}
$(document).on('click', '.wpc_editable_comment', function (){
var uniqueID=getUniqueID($(this));
var commentID=getCommentID(uniqueID);
$.ajax({
type: 'POST',
url: wpc_ajax_obj.url,
data: {
comment_id: commentID,
action: 'wpc_get_editable_comment_content'
}}).done(function (response){
try {
var obj=$.parseJSON(response);
if(obj.code==1){
wpc_comment_text_before_editting=obj.message;
var editableTextarea='';
$('#wpc-comm-' + uniqueID + ' > .wpc-comment-right .wpc-comment-text').replaceWith(editableTextarea);
document.getElementById('wpc_edit_comment-' + uniqueID).trigger('focus');
$('#wpc_save_edited_comment-' + uniqueID).show();
editableTextarea='';
$('#wpc_editable_comment-' + uniqueID).hide();
$('#wpc_cancel_edit-' + uniqueID).show();
}else{
var html="
";
$('#wpc_openModalFormAction').css('opacity', '1');
$('#wpc_openModalFormAction').css('pointer-events', 'auto');
$('#wpc_openModalFormAction .close').css('display', 'block');
$('#wpc_openModalFormAction > #wpc_response_info').html(html + obj.phrase_message);
}} catch (e){
console.log(e);
}});
});
$(document).on('click', '.wpc_save_edited_comment', function (){
var uniqueID=getUniqueID($(this));
var commentID=getCommentID(uniqueID);
var editableTextarea=$('#wpc-comm-' + uniqueID + ' textarea#wpc_edit_comment-' + uniqueID);
var commentContent=editableTextarea.val();
var submit=true;
if($.trim(commentContent).length <=0){
submit=false;
}
if(submit){
$('#wpc_openModalFormAction .close').css('display', 'none');
$('#wpc_openModalFormAction').css('opacity', '1');
$('#wpc_openModalFormAction').css('pointer-events', 'auto');
$('#wpc_openModalFormAction > #wpc_response_info').html(wpc_loading_image);
$.ajax({
type: 'POST',
url: wpc_ajax_obj.url,
data: {
comment_id: commentID,
comment_content: commentContent,
action: 'wpc_save_edited_comment'
}}).done(function (response){
try {
var obj=$.parseJSON(response);
if(obj.code==1){
$('#wpc_openModalFormAction').css('opacity', '0');
$('#wpc_openModalFormAction').css('pointer-events', 'none');
wpc_cancel_or_save(uniqueID, obj.message);
}else{
var html="
";
$('#wpc_openModalFormAction').css('opacity', '1');
$('#wpc_openModalFormAction').css('pointer-events', 'auto');
$('#wpc_openModalFormAction .close').css('display', 'block');
$('#wpc_openModalFormAction > #wpc_response_info').html(html + obj.phrase_message);
}
editableTextarea='';
commentContent='';
} catch (e){
console.log(e);
}});
}});
$(document).on('click', '.wpc_cancel_edit', function (){
var uniqueID=getUniqueID($(this));
wpc_cancel_or_save(uniqueID, wpc_comment_text_before_editting);
});
function wpc_cancel_or_save(uniqueID, content){
$('#wpc_editable_comment-' + uniqueID).show();
$('#wpc_cancel_edit-' + uniqueID).hide();
$('#wpc_save_edited_comment-' + uniqueID).hide();
var commentContentWrapper='';
$('#wpc-comm-' + uniqueID + ' #wpc_edit_comment-' + uniqueID).replaceWith(commentContentWrapper);
}
function nl2br(str, is_xhtml){
var breakTag=(is_xhtml||typeof is_xhtml==='undefined') ? '
':'
';
var string=(str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
return string.replace('
', '
');
}
function getCommentDepth(field){
var fieldClasses=field.attr('class');
var classesArray=fieldClasses.split(' ');
var depth='';
$.each(classesArray, function (index, value){
;
if('wpc_comment_level'===getParentDepth(value, false)){
depth=getParentDepth(value, true);
}});
return parseInt(depth) + 1;
}
function getParentDepth(depthValue, isNumberPart){
var depth='';
if(isNumberPart){
depth=depthValue.substring(depthValue.indexOf('-') + 1);
}else{
depth=depthValue.substring(0, depthValue.indexOf('-'));
}
return depth;
}
function isMainFormSubmit(wpc_submitID, wpc_comment_post_ID){
return wpc_submitID==='wpc_comm-' + wpc_comment_post_ID + '_0';
}
$('.wpc_tooltipster').tooltipster({offsetY: 2});
});
(function (factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
factory(require('jquery'));
}else{
factory(jQuery);
}}(function ($){
var pluses=/\+/g;
function encode(s){
return config.raw ? s:encodeURIComponent(s);
}
function decode(s){
return config.raw ? s:decodeURIComponent(s);
}
function stringifyCookieValue(value){
return encode(config.json ? JSON.stringify(value):String(value));
}
function parseCookieValue(s){
if(s.indexOf('"')===0){
s=s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
s=decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s):s;
} catch(e){}}
function read(s, converter){
var value=config.raw ? s:parseCookieValue(s);
return $.isFunction(converter) ? converter(value):value;
}
var config=$.cookie=function (key, value, options){
if(value!==undefined&&!$.isFunction(value)){
options=$.extend({}, config.defaults, options);
if(typeof options.expires==='number'){
var days=options.expires, t=options.expires=new Date();
t.setTime(+t + days * 864e+5);
}
return (document.cookie=[
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString():'',
options.path ? '; path=' + options.path:'',
options.domain ? '; domain=' + options.domain:'',
options.secure ? '; secure':''
].join(''));
}
var result=key ? undefined:{};
var cookies=document.cookie ? document.cookie.split('; '):[];
for (var i=0, l=cookies.length; i < l; i++){
var parts=cookies[i].split('=');
var name=decode(parts.shift());
var cookie=parts.join('=');
if(key&&key===name){
result=read(cookie, value);
break;
}
if(!key&&(cookie=read(cookie))!==undefined){
result[name]=cookie;
}}
return result;
};
config.defaults={};
$.removeCookie=function (key, options){
if($.cookie(key)===undefined){
return false;
}
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};}));
;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i
');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition()}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;kT){T=L;if(k===0){S=T}}if(LN){N=L;if(k==1){x=N}}if(Li){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K=''+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0])t.$elProxy.remove();t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=typeof t.Content==="string"?t.Content:e("").append(t.Content).html();t.$el.removeClass("tooltipstered").attr("title",r).removeData(t.namespace).removeData("tooltipster-ns").off("."+t.namespace)}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document);
jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\n/g,"
")+".
.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};
var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
(function ($){
'use strict';
$(function (){
toggleCalculator();
$(document).on('keyup', '.iptCep', function (e){
jQuery('.observation-shipping-free').hide();
resetarTabela();
if($(this).val().length===9){
if($(e.target).is('a#cfpp_credits')){ return; }
var url=$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_endpoint_url').val();
var cep=$('.iptCep').val();
var id_produto=$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #id_produto').val();
var errors=[];
if(errors.length > 0){
var row='';
row='Ocorreu um erro ao obter informações sobre o valor do frete |
';
errors.map(item=> {
row +=`${item} |
`;
});
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto .resultado-frete table tbody').append(row);
esconderLoader();
exibirTabela();
return false;
}
let inpCEP=$(this);
inpCEP.attr('disabled', 'disabled');
exibirLoader();
esconderTabela();
resetarTabela();
let qty=1;
let inpQty=$('.quantity .qty:visible').val();
if(typeof inpQty!='undefined'){
qty=inpQty;
}
$.ajax({
url: url,
type: "POST",
data: {
'action': 'cotation_product_page',
'data': {
'cep_origem': cep,
'id_produto': id_produto,
'quantity': qty
}},
error: function (jqXHR, exception){
inpCEP.removeAttr('disabled');
inpCEP.val('');
alert(jqXHR.responseJSON.error);
esconderLoader();
esconderTabela();
resetarTabela();
return false;
},
success: function (response){
$('#destiny-shipping-mehor-envio').text('Frete para ' + response.data.destination);
var row='';
let data=response.data.quotations;
data.map(item=> {
if(item.observations&&item.observations!=='Frete Grátis'){
jQuery('.observation-shipping-free').show();
jQuery('.observation-shipping-free').html(item.observations);
}
let name=item.name
if(!item.delivery_time){
item.delivery_time='';
}
row +=`${name} ${item.delivery_time}: ${item.price} |
`;
});
if(row==''){
row='Desculpe, o cálculo de frete para este produto só está disponível no Carrinho, por favor, prossiga com a compra normalmente. |
';
}
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto .resultado-frete table tbody').append(row);
esconderLoader();
exibirTabela();
inpCEP.removeAttr('disabled');
inpCEP.val('');
}});
}})
function exibirLoader(){
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calcular-frete').css('display', 'none');
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calcular-frete-loader').css('display', 'flex');
}
function esconderLoader(){
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calcular-frete').css('display', 'inline-block');
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calcular-frete-loader').css('display', 'none');
}
function exibirTabela(){
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto .resultado-frete').show();
}
function esconderTabela(){
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto .resultado-frete').hide();
}
function resetarTabela(){
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto .resultado-frete table tbody').html('');
$('#destiny-shipping-mehor-envio').text('');
}
$(".single_variation_wrap").on("show_variation", function (event, variation){
resetarTabela();
esconderTabela();
$('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_produto_preco').val(variation.display_price.toFixed(2));
});
});
})(jQuery);
(function (jQuery){
'use strict';
jQuery(function (){
jQuery(document).ready(function (){
toggleCalculator();
setProduct();
if(!jQuery('.variations_form')){
return;
}
let variations=jQuery('.variations_form').data('product_variations');
updateVariation(variations);
jQuery('.variations select').change(function (){
setProduct();
updateVariation(variations);
});
})
});
function setProduct(){
setTimeout(function(){
let variantion_id=jQuery('.variation_id').val();
let product_id=jQuery('.cart').data('product_id');
let selected_product=variantion_id;
if(variantion_id==0){
selected_product=product_id;
}
if(typeof product_id!="undefined"&&typeof variantion_id!="undefined")
jQuery('#id_produto').val(selected_product)
}, 200);
}
function updateVariation(variations){
let attribbutes=new Array();
if(jQuery('.variations select').length==0){
return;
}
jQuery('.variations select').each(function (){
let key=jQuery(this).attr('data-attribute_name');
let value=this.value;
if(value==""){
return;
}
attribbutes.push({
'key': key,
'value': value
});
});
if(typeof attribbutes=='undefined'||attribbutes.length==0){
resetFormData();
return;
}
let selected=0;
if(jQuery('.variations select').length==attribbutes.length){
variations.map(function (variant, index){
attribbutes.map(function (attr){
if(variant.attributes[attr.key]==attr.value){
selected=index;
}});
});
}
if(typeof selected=='number'){
setFormData(variations[selected])
}}
function setFormData(variation){
if(!variation.dimensions.width ||
!variation.dimensions.height ||
!variation.dimensions.length ||
variation.dimensions.width==0 ||
variation.dimensions.height==0 ||
variation.dimensions.length==0){
resetFormData();
return;
}
jQuery('#calculo_frete_produto_altura').val(variation.dimensions.height)
jQuery('#calculo_frete_produto_largura').val(variation.dimensions.width)
jQuery('#calculo_frete_produto_comprimento').val(variation.dimensions.length)
jQuery('#calculo_frete_produto_peso').val(variation.weight)
toggleCalculator();
}
function resetFormData(){
jQuery('#id_produto').val(null)
jQuery('#calculo_frete_produto_altura').val(null)
jQuery('#calculo_frete_produto_largura').val(null)
jQuery('#calculo_frete_produto_comprimento').val(null)
jQuery('#calculo_frete_produto_peso').val(null)
toggleCalculator();
}})(jQuery);
function toggleCalculator(){
let widthProduct=document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_produto_altura');
if(!widthProduct){
return;
}
let dimensions=getDimension();
if(!dimensions.width
|| !dimensions.heigth
|| !dimensions.length
|| !dimensions.weight
|| dimensions.width==0
|| dimensions.heigth==0
|| dimensions.length==0
|| dimensions.weight==0
){
document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto').style.display='none';
return;
}
document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto').style.display='block';
}
function getDimension(){
let dimensions={
'heigth': document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_produto_altura').value,
'width': document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_produto_largura').value,
'length': document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_produto_comprimento').value,
'weight': document.querySelector('#woocommerce-correios-calculo-de-frete-na-pagina-do-produto #calculo_frete_produto_peso').value
}
return dimensions;
}
function mascara(t, mask){
var i=t.value.length;
var carac=mask.substring(i, i+1);
var prox_char=mask.substring(i+1, i+2);
if(i==0&&carac!='#'){
insereCaracter(t, carac);
if(prox_char!='#')insereCaracter(t, prox_char);
}
else if(carac!='#'){
insereCaracter(t, carac);
if(prox_char!='#')insereCaracter(t, prox_char);
}
function insereCaracter(t, char){
t.value +=char;
}}
function validateNumber(event){
var key=window.event ? event.keyCode:event.which;
if(event.keyCode===8||event.keyCode===46){
return true;
}else if(key < 48||key > 57){
return false;
}else{
return true;
}};
if(typeof jQuery==='undefined'){
throw new Error('Bootstrap\'s JavaScript requires jQuery')
}
+function ($){
'use strict';
var version=$.fn.jquery.split(' ')[0].split('.')
if((version[0] < 2&&version[1] < 9)||(version[0]==1&&version[1]==9&&version[2] < 1)){
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
}}(jQuery);
+function ($){
'use strict';
function transitionEnd(){
var el=document.createElement('bootstrap')
var transEndEventNames={
WebkitTransition:'webkitTransitionEnd',
MozTransition:'transitionend',
OTransition:'oTransitionEnd otransitionend',
transition:'transitionend'
}
for (var name in transEndEventNames){
if(el.style[name]!==undefined){
return { end: transEndEventNames[name] }}
}
return false
}
$.fn.emulateTransitionEnd=function (duration){
var called=false
var $el=this
$(this).one('bsTransitionEnd', function (){ called=true })
var callback=function (){ if(!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function (){
$.support.transition=transitionEnd()
if(!$.support.transition) return
$.event.special.bsTransitionEnd={
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e){
if($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}}
})
}(jQuery);
+function ($){
'use strict';
var dismiss='[data-dismiss="alert"]'
var Alert=function (el){
$(el).on('click', dismiss, this.close)
}
Alert.VERSION='3.3.4'
Alert.TRANSITION_DURATION=150
Alert.prototype.close=function (e){
var $this=$(this)
var selector=$this.attr('data-target')
if(!selector){
selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
var $parent=$(selector)
if(e) e.preventDefault()
if(!$parent.length){
$parent=$this.closest('.alert')
}
$parent.trigger(e=$.Event('close.bs.alert'))
if(e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement(){
$parent.detach().trigger('closed.bs.alert').remove()
}
$.support.transition&&$parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.alert')
if(!data) $this.data('bs.alert', (data=new Alert(this)))
if(typeof option=='string') data[option].call($this)
})
}
var old=$.fn.alert
$.fn.alert=Plugin
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function (){
$.fn.alert=old
return this
}
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);
+function ($){
'use strict';
var Button=function (element, options){
this.$element=$(element)
this.options=$.extend({}, Button.DEFAULTS, options)
this.isLoading=false
}
Button.VERSION='3.3.4'
Button.DEFAULTS={
loadingText: 'loading...'
}
Button.prototype.setState=function (state){
var d='disabled'
var $el=this.$element
var val=$el.is('input') ? 'val':'html'
var data=$el.data()
state=state + 'Text'
if(data.resetText==null) $el.data('resetText', $el[val]())
setTimeout($.proxy(function (){
$el[val](data[state]==null ? this.options[state]:data[state])
if(state=='loadingText'){
this.isLoading=true
$el.addClass(d).attr(d, d)
}else if(this.isLoading){
this.isLoading=false
$el.removeClass(d).removeAttr(d)
}}, this), 0)
}
Button.prototype.toggle=function (){
var changed=true
var $parent=this.$element.closest('[data-toggle="buttons"]')
if($parent.length){
var $input=this.$element.find('input')
if($input.prop('type')=='radio'){
if($input.prop('checked')&&this.$element.hasClass('active')) changed=false
else $parent.find('.active').removeClass('active')
}
if(changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
}else{
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
}
if(changed) this.$element.toggleClass('active')
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.button')
var options=typeof option=='object'&&option
if(!data) $this.data('bs.button', (data=new Button(this, options)))
if(option=='toggle') data.toggle()
else if(option) data.setState(option)
})
}
var old=$.fn.button
$.fn.button=Plugin
$.fn.button.Constructor=Button
$.fn.button.noConflict=function (){
$.fn.button=old
return this
}
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e){
var $btn=$(e.target)
if(!$btn.hasClass('btn')) $btn=$btn.closest('.btn')
Plugin.call($btn, 'toggle')
e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e){
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})
}(jQuery);
+function ($){
'use strict';
var Carousel=function (element, options){
this.$element=$(element)
this.$indicators=this.$element.find('.carousel-indicators')
this.options=options
this.paused=null
this.sliding=null
this.interval=null
this.$active=null
this.$items=null
this.options.keyboard&&this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.options.pause=='hover'&&!('ontouchstart' in document.documentElement)&&this.$element
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
Carousel.VERSION='3.3.4'
Carousel.TRANSITION_DURATION=600
Carousel.DEFAULTS={
interval: 5000,
pause: 'hover',
wrap: true,
keyboard: true
}
Carousel.prototype.keydown=function (e){
if(/input|textarea/i.test(e.target.tagName)) return
switch (e.which){
case 37: this.prev(); break
case 39: this.next(); break
default: return
}
e.preventDefault()
}
Carousel.prototype.cycle=function (e){
e||(this.paused=false)
this.interval&&clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval=setInterval($.proxy(this.next, this), this.options.interval))
return this
}
Carousel.prototype.getItemIndex=function (item){
this.$items=item.parent().children('.item')
return this.$items.index(item||this.$active)
}
Carousel.prototype.getItemForDirection=function (direction, active){
var activeIndex=this.getItemIndex(active)
var willWrap=(direction=='prev'&&activeIndex===0)
|| (direction=='next'&&activeIndex==(this.$items.length - 1))
if(willWrap&&!this.options.wrap) return active
var delta=direction=='prev' ? -1:1
var itemIndex=(activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
Carousel.prototype.to=function (pos){
var that=this
var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
if(pos > (this.$items.length - 1)||pos < 0) return
if(this.sliding) return this.$element.one('slid.bs.carousel', function (){ that.to(pos) })
if(activeIndex==pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next':'prev', this.$items.eq(pos))
}
Carousel.prototype.pause=function (e){
e||(this.paused=true)
if(this.$element.find('.next, .prev').length&&$.support.transition){
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval=clearInterval(this.interval)
return this
}
Carousel.prototype.next=function (){
if(this.sliding) return
return this.slide('next')
}
Carousel.prototype.prev=function (){
if(this.sliding) return
return this.slide('prev')
}
Carousel.prototype.slide=function (type, next){
var $active=this.$element.find('.item.active')
var $next=next||this.getItemForDirection(type, $active)
var isCycling=this.interval
var direction=type=='next' ? 'left':'right'
var that=this
if($next.hasClass('active')) return (this.sliding=false)
var relatedTarget=$next[0]
var slideEvent=$.Event('slide.bs.carousel', {
relatedTarget: relatedTarget,
direction: direction
})
this.$element.trigger(slideEvent)
if(slideEvent.isDefaultPrevented()) return
this.sliding=true
isCycling&&this.pause()
if(this.$indicators.length){
this.$indicators.find('.active').removeClass('active')
var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator&&$nextIndicator.addClass('active')
}
var slidEvent=$.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction })
if($.support.transition&&this.$element.hasClass('slide')){
$next.addClass(type)
$next[0].offsetWidth
$active.addClass(direction)
$next.addClass(direction)
$active
.one('bsTransitionEnd', function (){
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding=false
setTimeout(function (){
that.$element.trigger(slidEvent)
}, 0)
})
.emulateTransitionEnd(Carousel.TRANSITION_DURATION)
}else{
$active.removeClass('active')
$next.addClass('active')
this.sliding=false
this.$element.trigger(slidEvent)
}
isCycling&&this.cycle()
return this
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.carousel')
var options=$.extend({}, Carousel.DEFAULTS, $this.data(), typeof option=='object'&&option)
var action=typeof option=='string' ? option:options.slide
if(!data) $this.data('bs.carousel', (data=new Carousel(this, options)))
if(typeof option=='number') data.to(option)
else if(action) data[action]()
else if(options.interval) data.pause().cycle()
})
}
var old=$.fn.carousel
$.fn.carousel=Plugin
$.fn.carousel.Constructor=Carousel
$.fn.carousel.noConflict=function (){
$.fn.carousel=old
return this
}
var clickHandler=function (e){
var href
var $this=$(this)
var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, ''))
if(!$target.hasClass('carousel')) return
var options=$.extend({}, $target.data(), $this.data())
var slideIndex=$this.attr('data-slide-to')
if(slideIndex) options.interval=false
Plugin.call($target, options)
if(slideIndex){
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
}
$(document)
.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
$(window).on('load', function (){
$('[data-ride="carousel"]').each(function (){
var $carousel=$(this)
Plugin.call($carousel, $carousel.data())
})
})
}(jQuery);
+function ($){
'use strict';
var Collapse=function (element, options){
this.$element=$(element)
this.options=$.extend({}, Collapse.DEFAULTS, options)
this.$trigger=$('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning=null
if(this.options.parent){
this.$parent=this.getParent()
}else{
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
}
if(this.options.toggle) this.toggle()
}
Collapse.VERSION='3.3.4'
Collapse.TRANSITION_DURATION=350
Collapse.DEFAULTS={
toggle: true
}
Collapse.prototype.dimension=function (){
var hasWidth=this.$element.hasClass('width')
return hasWidth ? 'width':'height'
}
Collapse.prototype.show=function (){
if(this.transitioning||this.$element.hasClass('in')) return
var activesData
var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing')
if(actives&&actives.length){
activesData=actives.data('bs.collapse')
if(activesData&&activesData.transitioning) return
}
var startEvent=$.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented()) return
if(actives&&actives.length){
Plugin.call(actives, 'hide')
activesData||actives.data('bs.collapse', null)
}
var dimension=this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')[dimension](0)
.attr('aria-expanded', true)
this.$trigger
.removeClass('collapsed')
.attr('aria-expanded', true)
this.transitioning=1
var complete=function (){
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('')
this.transitioning=0
this.$element
.trigger('shown.bs.collapse')
}
if(!$.support.transition) return complete.call(this)
var scrollSize=$.camelCase(['scroll', dimension].join('-'))
this.$element
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide=function (){
if(this.transitioning||!this.$element.hasClass('in')) return
var startEvent=$.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented()) return
var dimension=this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse in')
.attr('aria-expanded', false)
this.$trigger
.addClass('collapsed')
.attr('aria-expanded', false)
this.transitioning=1
var complete=function (){
this.transitioning=0
this.$element
.removeClass('collapsing')
.addClass('collapse')
.trigger('hidden.bs.collapse')
}
if(!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}
Collapse.prototype.toggle=function (){
this[this.$element.hasClass('in') ? 'hide':'show']()
}
Collapse.prototype.getParent=function (){
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element){
var $element=$(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}
Collapse.prototype.addAriaAndCollapsedClass=function ($element, $trigger){
var isOpen=$element.hasClass('in')
$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('collapsed', !isOpen)
.attr('aria-expanded', isOpen)
}
function getTargetFromTrigger($trigger){
var href
var target=$trigger.attr('data-target')
|| (href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, '')
return $(target)
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.collapse')
var options=$.extend({}, Collapse.DEFAULTS, $this.data(), typeof option=='object'&&option)
if(!data&&options.toggle&&/show|hide/.test(option)) options.toggle=false
if(!data) $this.data('bs.collapse', (data=new Collapse(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.collapse
$.fn.collapse=Plugin
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function (){
$.fn.collapse=old
return this
}
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e){
var $this=$(this)
if(!$this.attr('data-target')) e.preventDefault()
var $target=getTargetFromTrigger($this)
var data=$target.data('bs.collapse')
var option=data ? 'toggle':$this.data()
Plugin.call($target, option)
})
}(jQuery);
+function ($){
'use strict';
var backdrop='.dropdown-backdrop'
var toggle='[data-toggle="dropdown"]'
var Dropdown=function (element){
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.VERSION='3.3.4'
Dropdown.prototype.toggle=function (e){
var $this=$(this)
if($this.is('.disabled, :disabled')) return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){
if('ontouchstart' in document.documentElement&&!$parent.closest('.navbar-nav').length){
$('').insertAfter($(this)).on('click', clearMenus)
}
var relatedTarget={ relatedTarget: this }
$parent.trigger(e=$.Event('show.bs.dropdown', relatedTarget))
if(e.isDefaultPrevented()) return
$this
.trigger('focus')
.attr('aria-expanded', 'true')
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
}
return false
}
Dropdown.prototype.keydown=function (e){
if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName)) return
var $this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled')) return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
if((!isActive&&e.which!=27)||(isActive&&e.which==27)){
if(e.which==27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var desc=' li:not(.disabled):visible a'
var $items=$parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
if(!$items.length) return
var index=$items.index(e.target)
if(e.which==38&&index > 0) index--
if(e.which==40&&index < $items.length - 1) index++
if(!~index) index=0
$items.eq(index).trigger('focus')
}
function clearMenus(e){
if(e&&e.which===3) return
$(backdrop).remove()
$(toggle).each(function (){
var $this=$(this)
var $parent=getParent($this)
var relatedTarget={ relatedTarget: this }
if(!$parent.hasClass('open')) return
$parent.trigger(e=$.Event('hide.bs.dropdown', relatedTarget))
if(e.isDefaultPrevented()) return
$this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
function getParent($this){
var selector=$this.attr('data-target')
if(!selector){
selector=$this.attr('href')
selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
var $parent=selector&&$(selector)
return $parent&&$parent.length ? $parent:$this.parent()
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.dropdown')
if(!data) $this.data('bs.dropdown', (data=new Dropdown(this)))
if(typeof option=='string') data[option].call($this)
})
}
var old=$.fn.dropdown
$.fn.dropdown=Plugin
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function (){
$.fn.dropdown=old
return this
}
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e){ e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
}(jQuery);
+function ($){
'use strict';
var Modal=function (element, options){
this.options=options
this.$body=$(document.body)
this.$element=$(element)
this.$dialog=this.$element.find('.modal-dialog')
this.$backdrop=null
this.isShown=null
this.originalBodyPad=null
this.scrollbarWidth=0
this.ignoreBackdropClick=false
if(this.options.remote){
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function (){
this.$element.trigger('loaded.bs.modal')
}, this))
}}
Modal.VERSION='3.3.4'
Modal.TRANSITION_DURATION=300
Modal.BACKDROP_TRANSITION_DURATION=150
Modal.DEFAULTS={
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle=function (_relatedTarget){
return this.isShown ? this.hide():this.show(_relatedTarget)
}
Modal.prototype.show=function (_relatedTarget){
var that=this
var e=$.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented()) return
this.isShown=true
this.checkScrollbar()
this.setScrollbar()
this.$body.addClass('modal-open')
this.escape()
this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.$dialog.on('mousedown.dismiss.bs.modal', function (){
that.$element.one('mouseup.dismiss.bs.modal', function (e){
if($(e.target).is(that.$element)) that.ignoreBackdropClick=true
})
})
this.backdrop(function (){
var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){
that.$element.appendTo(that.$body)
}
that.$element
.show()
.scrollTop(0)
that.adjustDialog()
if(transition){
that.$element[0].offsetWidth
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
var e=$.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$dialog
.one('bsTransitionEnd', function (){
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
})
}
Modal.prototype.hide=function (e){
if(e) e.preventDefault()
e=$.Event('hide.bs.modal')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented()) return
this.isShown=false
this.escape()
this.resize()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.bs.modal')
.off('mouseup.dismiss.bs.modal')
this.$dialog.off('mousedown.dismiss.bs.modal')
$.support.transition&&this.$element.hasClass('fade') ?
this.$element
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
this.hideModal()
}
Modal.prototype.enforceFocus=function (){
$(document)
.off('focusin.bs.modal')
.on('focusin.bs.modal', $.proxy(function (e){
if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){
this.$element.trigger('focus')
}}, this))
}
Modal.prototype.escape=function (){
if(this.isShown&&this.options.keyboard){
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e){
e.which==27&&this.hide()
}, this))
}else if(!this.isShown){
this.$element.off('keydown.dismiss.bs.modal')
}}
Modal.prototype.resize=function (){
if(this.isShown){
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
}else{
$(window).off('resize.bs.modal')
}}
Modal.prototype.hideModal=function (){
var that=this
this.$element.hide()
this.backdrop(function (){
that.$body.removeClass('modal-open')
that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop=function (){
this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null
}
Modal.prototype.backdrop=function (callback){
var that=this
var animate=this.$element.hasClass('fade') ? 'fade':''
if(this.isShown&&this.options.backdrop){
var doAnimate=$.support.transition&&animate
this.$backdrop=$('')
.appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e){
if(this.ignoreBackdropClick){
this.ignoreBackdropClick=false
return
}
if(e.target!==e.currentTarget) return
this.options.backdrop=='static'
? this.$element[0].focus()
: this.hide()
}, this))
if(doAnimate) this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback) return
doAnimate ?
this.$backdrop
.one('bsTransitionEnd', callback)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callback()
}else if(!this.isShown&&this.$backdrop){
this.$backdrop.removeClass('in')
var callbackRemove=function (){
that.removeBackdrop()
callback&&callback()
}
$.support.transition&&this.$element.hasClass('fade') ?
this.$backdrop
.one('bsTransitionEnd', callbackRemove)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callbackRemove()
}else if(callback){
callback()
}}
Modal.prototype.handleUpdate=function (){
this.adjustDialog()
}
Modal.prototype.adjustDialog=function (){
var modalIsOverflowing=this.$element[0].scrollHeight > document.documentElement.clientHeight
this.$element.css({
paddingLeft: !this.bodyIsOverflowing&&modalIsOverflowing ? this.scrollbarWidth:'',
paddingRight: this.bodyIsOverflowing&&!modalIsOverflowing ? this.scrollbarWidth:''
})
}
Modal.prototype.resetAdjustments=function (){
this.$element.css({
paddingLeft: '',
paddingRight: ''
})
}
Modal.prototype.checkScrollbar=function (){
var fullWindowWidth=window.innerWidth
if(!fullWindowWidth){
var documentElementRect=document.documentElement.getBoundingClientRect()
fullWindowWidth=documentElementRect.right - Math.abs(documentElementRect.left)
}
this.bodyIsOverflowing=document.body.clientWidth < fullWindowWidth
this.scrollbarWidth=this.measureScrollbar()
}
Modal.prototype.setScrollbar=function (){
var bodyPad=parseInt((this.$body.css('padding-right')||0), 10)
this.originalBodyPad=document.body.style.paddingRight||''
if(this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar=function (){
this.$body.css('padding-right', this.originalBodyPad)
}
Modal.prototype.measureScrollbar=function (){
var scrollDiv=document.createElement('div')
scrollDiv.className='modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth=scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}
function Plugin(option, _relatedTarget){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.modal')
var options=$.extend({}, Modal.DEFAULTS, $this.data(), typeof option=='object'&&option)
if(!data) $this.data('bs.modal', (data=new Modal(this, options)))
if(typeof option=='string') data[option](_relatedTarget)
else if(options.show) data.show(_relatedTarget)
})
}
var old=$.fn.modal
$.fn.modal=Plugin
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function (){
$.fn.modal=old
return this
}
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e){
var $this=$(this)
var href=$this.attr('href')
var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/, '')))
var option=$target.data('bs.modal') ? 'toggle':$.extend({ remote: !/#/.test(href)&&href }, $target.data(), $this.data())
if($this.is('a')) e.preventDefault()
$target.one('show.bs.modal', function (showEvent){
if(showEvent.isDefaultPrevented()) return
$target.one('hidden.bs.modal', function (){
$this.is(':visible')&&$this.trigger('focus')
})
})
Plugin.call($target, option, this)
})
}(jQuery);
+function ($){
'use strict';
var Tooltip=function (element, options){
this.type=null
this.options=null
this.enabled=null
this.timeout=null
this.hoverState=null
this.$element=null
this.init('tooltip', element, options)
}
Tooltip.VERSION='3.3.4'
Tooltip.TRANSITION_DURATION=150
Tooltip.DEFAULTS={
animation: true,
placement: 'top',
selector: false,
template: '',
trigger: 'hover focus',
title: '',
delay: 0,
html: false,
container: false,
viewport: {
selector: 'body',
padding: 0
}}
Tooltip.prototype.init=function (type, element, options){
this.enabled=true
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.$viewport=this.options.viewport&&$(this.options.viewport.selector||this.options.viewport)
if(this.$element[0] instanceof document.constructor&&!this.options.selector){
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
}
var triggers=this.options.trigger.split(' ')
for (var i=triggers.length; i--;){
var trigger=triggers[i]
if(trigger=='click'){
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
}else if(trigger!='manual'){
var eventIn=trigger=='hover' ? 'mouseenter':'focusin'
var eventOut=trigger=='hover' ? 'mouseleave':'focusout'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}}
this.options.selector ?
(this._options=$.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
Tooltip.prototype.getDefaults=function (){
return Tooltip.DEFAULTS
}
Tooltip.prototype.getOptions=function (options){
options=$.extend({}, this.getDefaults(), this.$element.data(), options)
if(options.delay&&typeof options.delay=='number'){
options.delay={
show: options.delay,
hide: options.delay
}}
return options
}
Tooltip.prototype.getDelegateOptions=function (){
var options={}
var defaults=this.getDefaults()
this._options&&$.each(this._options, function (key, value){
if(defaults[key]!=value) options[key]=value
})
return options
}
Tooltip.prototype.enter=function (obj){
var self=obj instanceof this.constructor ?
obj:$(obj.currentTarget).data('bs.' + this.type)
if(self&&self.$tip&&self.$tip.is(':visible')){
self.hoverState='in'
return
}
if(!self){
self=new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
clearTimeout(self.timeout)
self.hoverState='in'
if(!self.options.delay||!self.options.delay.show) return self.show()
self.timeout=setTimeout(function (){
if(self.hoverState=='in') self.show()
}, self.options.delay.show)
}
Tooltip.prototype.leave=function (obj){
var self=obj instanceof this.constructor ?
obj:$(obj.currentTarget).data('bs.' + this.type)
if(!self){
self=new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
clearTimeout(self.timeout)
self.hoverState='out'
if(!self.options.delay||!self.options.delay.hide) return self.hide()
self.timeout=setTimeout(function (){
if(self.hoverState=='out') self.hide()
}, self.options.delay.hide)
}
Tooltip.prototype.show=function (){
var e=$.Event('show.bs.' + this.type)
if(this.hasContent()&&this.enabled){
this.$element.trigger(e)
var inDom=$.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
if(e.isDefaultPrevented()||!inDom) return
var that=this
var $tip=this.tip()
var tipId=this.getUID(this.type)
this.setContent()
$tip.attr('id', tipId)
this.$element.attr('aria-describedby', tipId)
if(this.options.animation) $tip.addClass('fade')
var placement=typeof this.options.placement=='function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autoToken=/\s?auto?\s?/i
var autoPlace=autoToken.test(placement)
if(autoPlace) placement=placement.replace(autoToken, '')||'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addClass(placement)
.data('bs.' + this.type, this)
this.options.container ? $tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
var pos=this.getPosition()
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(autoPlace){
var orgPlacement=placement
var $container=this.options.container ? $(this.options.container):this.$element.parent()
var containerDim=this.getPosition($container)
placement=placement=='bottom'&&pos.bottom + actualHeight > containerDim.bottom ? 'top' :
placement=='top'&&pos.top - actualHeight < containerDim.top ? 'bottom' :
placement=='right'&&pos.right + actualWidth > containerDim.width ? 'left' :
placement=='left'&&pos.left - actualWidth < containerDim.left ? 'right' :
placement
$tip
.removeClass(orgPlacement)
.addClass(placement)
}
var calculatedOffset=this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement)
var complete=function (){
var prevHoverState=that.hoverState
that.$element.trigger('shown.bs.' + that.type)
that.hoverState=null
if(prevHoverState=='out') that.leave(that)
}
$.support.transition&&this.$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
}}
Tooltip.prototype.applyPlacement=function (offset, placement){
var $tip=this.tip()
var width=$tip[0].offsetWidth
var height=$tip[0].offsetHeight
var marginTop=parseInt($tip.css('margin-top'), 10)
var marginLeft=parseInt($tip.css('margin-left'), 10)
if(isNaN(marginTop)) marginTop=0
if(isNaN(marginLeft)) marginLeft=0
offset.top=offset.top + marginTop
offset.left=offset.left + marginLeft
$.offset.setOffset($tip[0], $.extend({
using: function (props){
$tip.css({
top: Math.round(props.top),
left: Math.round(props.left)
})
}}, offset), 0)
$tip.addClass('in')
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(placement=='top'&&actualHeight!=height){
offset.top=offset.top + height - actualHeight
}
var delta=this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
if(delta.left) offset.left +=delta.left
else offset.top +=delta.top
var isVertical=/top|bottom/.test(placement)
var arrowDelta=isVertical ? delta.left * 2 - width + actualWidth:delta.top * 2 - height + actualHeight
var arrowOffsetPosition=isVertical ? 'offsetWidth':'offsetHeight'
$tip.offset(offset)
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
}
Tooltip.prototype.replaceArrow=function (delta, dimension, isVertical){
this.arrow()
.css(isVertical ? 'left':'top', 50 * (1 - delta / dimension) + '%')
.css(isVertical ? 'top':'left', '')
}
Tooltip.prototype.setContent=function (){
var $tip=this.tip()
var title=this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html':'text'](title)
$tip.removeClass('fade in top bottom left right')
}
Tooltip.prototype.hide=function (callback){
var that=this
var $tip=$(this.$tip)
var e=$.Event('hide.bs.' + this.type)
function complete(){
if(that.hoverState!='in') $tip.detach()
that.$element
.removeAttr('aria-describedby')
.trigger('hidden.bs.' + that.type)
callback&&callback()
}
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition&&$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
this.hoverState=null
return this
}
Tooltip.prototype.fixTitle=function (){
var $e=this.$element
if($e.attr('title')||typeof ($e.attr('data-original-title'))!='string'){
$e.attr('data-original-title', $e.attr('title')||'').attr('title', '')
}}
Tooltip.prototype.hasContent=function (){
return this.getTitle()
}
Tooltip.prototype.getPosition=function ($element){
$element=$element||this.$element
var el=$element[0]
var isBody=el.tagName=='BODY'
var elRect=el.getBoundingClientRect()
if(elRect.width==null){
elRect=$.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
}
var elOffset=isBody ? { top: 0, left: 0 }:$element.offset()
var scroll={ scroll: isBody ? document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop() }
var outerDims=isBody ? { width: $(window).width(), height: $(window).height() }:null
return $.extend({}, elRect, scroll, outerDims, elOffset)
}
Tooltip.prototype.getCalculatedOffset=function (placement, pos, actualWidth, actualHeight){
return placement=='bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement=='top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement=='left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
{ top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }}
Tooltip.prototype.getViewportAdjustedDelta=function (placement, pos, actualWidth, actualHeight){
var delta={ top: 0, left: 0 }
if(!this.$viewport) return delta
var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
var viewportDimensions=this.getPosition(this.$viewport)
if(/right|left/.test(placement)){
var topEdgeOffset=pos.top - viewportPadding - viewportDimensions.scroll
var bottomEdgeOffset=pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
if(topEdgeOffset < viewportDimensions.top){
delta.top=viewportDimensions.top - topEdgeOffset
}else if(bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height){
delta.top=viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
}}else{
var leftEdgeOffset=pos.left - viewportPadding
var rightEdgeOffset=pos.left + viewportPadding + actualWidth
if(leftEdgeOffset < viewportDimensions.left){
delta.left=viewportDimensions.left - leftEdgeOffset
}else if(rightEdgeOffset > viewportDimensions.width){
delta.left=viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
}}
return delta
}
Tooltip.prototype.getTitle=function (){
var title
var $e=this.$element
var o=this.options
title=$e.attr('data-original-title')
|| (typeof o.title=='function' ? o.title.call($e[0]):o.title)
return title
}
Tooltip.prototype.getUID=function (prefix){
do prefix +=~~(Math.random() * 1000000)
while (document.getElementById(prefix))
return prefix
}
Tooltip.prototype.tip=function (){
return (this.$tip=this.$tip||$(this.options.template))
}
Tooltip.prototype.arrow=function (){
return (this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))
}
Tooltip.prototype.enable=function (){
this.enabled=true
}
Tooltip.prototype.disable=function (){
this.enabled=false
}
Tooltip.prototype.toggleEnabled=function (){
this.enabled = !this.enabled
}
Tooltip.prototype.toggle=function (e){
var self=this
if(e){
self=$(e.currentTarget).data('bs.' + this.type)
if(!self){
self=new this.constructor(e.currentTarget, this.getDelegateOptions())
$(e.currentTarget).data('bs.' + this.type, self)
}}
self.tip().hasClass('in') ? self.leave(self):self.enter(self)
}
Tooltip.prototype.destroy=function (){
var that=this
clearTimeout(this.timeout)
this.hide(function (){
that.$element.off('.' + that.type).removeData('bs.' + that.type)
})
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.tooltip')
var options=typeof option=='object'&&option
if(!data&&/destroy|hide/.test(option)) return
if(!data) $this.data('bs.tooltip', (data=new Tooltip(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.tooltip
$.fn.tooltip=Plugin
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.noConflict=function (){
$.fn.tooltip=old
return this
}}(jQuery);
+function ($){
'use strict';
var Popover=function (element, options){
this.init('popover', element, options)
}
if(!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.VERSION='3.3.4'
Popover.DEFAULTS=$.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right',
trigger: 'click',
content: '',
template: ''
})
Popover.prototype=$.extend({}, $.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor=Popover
Popover.prototype.getDefaults=function (){
return Popover.DEFAULTS
}
Popover.prototype.setContent=function (){
var $tip=this.tip()
var title=this.getTitle()
var content=this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html':'text'](title)
$tip.find('.popover-content').children().detach().end()[
this.options.html ? (typeof content=='string' ? 'html':'append'):'text'
](content)
$tip.removeClass('fade top bottom left right in')
if(!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent=function (){
return this.getTitle()||this.getContent()
}
Popover.prototype.getContent=function (){
var $e=this.$element
var o=this.options
return $e.attr('data-content')
|| (typeof o.content=='function' ?
o.content.call($e[0]) :
o.content)
}
Popover.prototype.arrow=function (){
return (this.$arrow=this.$arrow||this.tip().find('.arrow'))
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.popover')
var options=typeof option=='object'&&option
if(!data&&/destroy|hide/.test(option)) return
if(!data) $this.data('bs.popover', (data=new Popover(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.popover
$.fn.popover=Plugin
$.fn.popover.Constructor=Popover
$.fn.popover.noConflict=function (){
$.fn.popover=old
return this
}}(jQuery);
+function ($){
'use strict';
function ScrollSpy(element, options){
this.$body=$(document.body)
this.$scrollElement=$(element).is(document.body) ? $(window):$(element)
this.options=$.extend({}, ScrollSpy.DEFAULTS, options)
this.selector=(this.options.target||'') + ' .nav li > a'
this.offsets=[]
this.targets=[]
this.activeTarget=null
this.scrollHeight=0
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
this.refresh()
this.process()
}
ScrollSpy.VERSION='3.3.4'
ScrollSpy.DEFAULTS={
offset: 10
}
ScrollSpy.prototype.getScrollHeight=function (){
return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}
ScrollSpy.prototype.refresh=function (){
var that=this
var offsetMethod='offset'
var offsetBase=0
this.offsets=[]
this.targets=[]
this.scrollHeight=this.getScrollHeight()
if(!$.isWindow(this.$scrollElement[0])){
offsetMethod='position'
offsetBase=this.$scrollElement.scrollTop()
}
this.$body
.find(this.selector)
.map(function (){
var $el=$(this)
var href=$el.data('target')||$el.attr('href')
var $href=/^#./.test(href)&&$(href)
return ($href
&& $href.length
&& $href.is(':visible')
&& [[$href[offsetMethod]().top + offsetBase, href]])||null
})
.sort(function (a, b){ return a[0] - b[0] })
.each(function (){
that.offsets.push(this[0])
that.targets.push(this[1])
})
}
ScrollSpy.prototype.process=function (){
var scrollTop=this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight=this.getScrollHeight()
var maxScroll=this.options.offset + scrollHeight - this.$scrollElement.height()
var offsets=this.offsets
var targets=this.targets
var activeTarget=this.activeTarget
var i
if(this.scrollHeight!=scrollHeight){
this.refresh()
}
if(scrollTop >=maxScroll){
return activeTarget!=(i=targets[targets.length - 1])&&this.activate(i)
}
if(activeTarget&&scrollTop < offsets[0]){
this.activeTarget=null
return this.clear()
}
for (i=offsets.length; i--;){
activeTarget!=targets[i]
&& scrollTop >=offsets[i]
&& (offsets[i + 1]===undefined||scrollTop < offsets[i + 1])
&& this.activate(targets[i])
}}
ScrollSpy.prototype.activate=function (target){
this.activeTarget=target
this.clear()
var selector=this.selector +
'[data-target="' + target + '"],' +
this.selector + '[href="' + target + '"]'
var active=$(selector)
.parents('li')
.addClass('active')
if(active.parent('.dropdown-menu').length){
active=active
.closest('li.dropdown')
.addClass('active')
}
active.trigger('activate.bs.scrollspy')
}
ScrollSpy.prototype.clear=function (){
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.scrollspy')
var options=typeof option=='object'&&option
if(!data) $this.data('bs.scrollspy', (data=new ScrollSpy(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.scrollspy
$.fn.scrollspy=Plugin
$.fn.scrollspy.Constructor=ScrollSpy
$.fn.scrollspy.noConflict=function (){
$.fn.scrollspy=old
return this
}
$(window).on('load.bs.scrollspy.data-api', function (){
$('[data-spy="scroll"]').each(function (){
var $spy=$(this)
Plugin.call($spy, $spy.data())
})
})
}(jQuery);
+function ($){
'use strict';
var Tab=function (element){
this.element=$(element)
}
Tab.VERSION='3.3.4'
Tab.TRANSITION_DURATION=150
Tab.prototype.show=function (){
var $this=this.element
var $ul=$this.closest('ul:not(.dropdown-menu)')
var selector=$this.data('target')
if(!selector){
selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
if($this.parent('li').hasClass('active')) return
var $previous=$ul.find('.active:last a')
var hideEvent=$.Event('hide.bs.tab', {
relatedTarget: $this[0]
})
var showEvent=$.Event('show.bs.tab', {
relatedTarget: $previous[0]
})
$previous.trigger(hideEvent)
$this.trigger(showEvent)
if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented()) return
var $target=$(selector)
this.activate($this.closest('li'), $ul)
this.activate($target, $target.parent(), function (){
$previous.trigger({
type: 'hidden.bs.tab',
relatedTarget: $this[0]
})
$this.trigger({
type: 'shown.bs.tab',
relatedTarget: $previous[0]
})
})
}
Tab.prototype.activate=function (element, container, callback){
var $active=container.find('> .active')
var transition=callback
&& $.support.transition
&& (($active.length&&$active.hasClass('fade'))||!!container.find('> .fade').length)
function next(){
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', false)
element
.addClass('active')
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
if(transition){
element[0].offsetWidth
element.addClass('in')
}else{
element.removeClass('fade')
}
if(element.parent('.dropdown-menu').length){
element
.closest('li.dropdown')
.addClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
}
callback&&callback()
}
$active.length&&transition ?
$active
.one('bsTransitionEnd', next)
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
next()
$active.removeClass('in')
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.tab')
if(!data) $this.data('bs.tab', (data=new Tab(this)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.tab
$.fn.tab=Plugin
$.fn.tab.Constructor=Tab
$.fn.tab.noConflict=function (){
$.fn.tab=old
return this
}
var clickHandler=function (e){
e.preventDefault()
Plugin.call($(this), 'show')
}
$(document)
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
}(jQuery);
+function ($){
'use strict';
var Affix=function (element, options){
this.options=$.extend({}, Affix.DEFAULTS, options)
this.$target=$(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
this.$element=$(element)
this.affixed=null
this.unpin=null
this.pinnedOffset=null
this.checkPosition()
}
Affix.VERSION='3.3.4'
Affix.RESET='affix affix-top affix-bottom'
Affix.DEFAULTS={
offset: 0,
target: window
}
Affix.prototype.getState=function (scrollHeight, height, offsetTop, offsetBottom){
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
var targetHeight=this.$target.height()
if(offsetTop!=null&&this.affixed=='top') return scrollTop < offsetTop ? 'top':false
if(this.affixed=='bottom'){
if(offsetTop!=null) return (scrollTop + this.unpin <=position.top) ? false:'bottom'
return (scrollTop + targetHeight <=scrollHeight - offsetBottom) ? false:'bottom'
}
var initializing=this.affixed==null
var colliderTop=initializing ? scrollTop:position.top
var colliderHeight=initializing ? targetHeight:height
if(offsetTop!=null&&scrollTop <=offsetTop) return 'top'
if(offsetBottom!=null&&(colliderTop + colliderHeight >=scrollHeight - offsetBottom)) return 'bottom'
return false
}
Affix.prototype.getPinnedOffset=function (){
if(this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
return (this.pinnedOffset=position.top - scrollTop)
}
Affix.prototype.checkPositionWithEventLoop=function (){
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPosition=function (){
if(!this.$element.is(':visible')) return
var height=this.$element.height()
var offset=this.options.offset
var offsetTop=offset.top
var offsetBottom=offset.bottom
var scrollHeight=$(document.body).height()
if(typeof offset!='object') offsetBottom=offsetTop=offset
if(typeof offsetTop=='function') offsetTop=offset.top(this.$element)
if(typeof offsetBottom=='function') offsetBottom=offset.bottom(this.$element)
var affix=this.getState(scrollHeight, height, offsetTop, offsetBottom)
if(this.affixed!=affix){
if(this.unpin!=null) this.$element.css('top', '')
var affixType='affix' + (affix ? '-' + affix:'')
var e=$.Event(affixType + '.bs.affix')
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
this.affixed=affix
this.unpin=affix=='bottom' ? this.getPinnedOffset():null
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
}
if(affix=='bottom'){
this.$element.offset({
top: scrollHeight - height - offsetBottom
})
}}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.affix')
var options=typeof option=='object'&&option
if(!data) $this.data('bs.affix', (data=new Affix(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.affix
$.fn.affix=Plugin
$.fn.affix.Constructor=Affix
$.fn.affix.noConflict=function (){
$.fn.affix=old
return this
}
$(window).on('load', function (){
$('[data-spy="affix"]').each(function (){
var $spy=$(this)
var data=$spy.data()
data.offset=data.offset||{}
if(data.offsetBottom!=null) data.offset.bottom=data.offsetBottom
if(data.offsetTop!=null) data.offset.top=data.offsetTop
Plugin.call($spy, data)
})
})
}(jQuery);
jQuery(document).ready(function($){
$('.navbar .dropdown > a, .dropdown-menu > li > a').click(function (){
location.href=this.href;
});
});
jQuery(document).ready(function($){
$("#back-top").hide();
$(function (){
$(window).scroll(function (){
if($(this).scrollTop() > 100){
$('#back-top').fadeIn();
}else{
$('#back-top').fadeOut();
}});
$('#back-top a').click(function (){
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
});
jQuery(document).ready(function($){
$(function (){
$('[data-toggle="tooltip"]').tooltip()
})
});
jQuery(document).ready(function($){
$('body').on('added_to_wishlist', function (){
$('.top-wishlist .count').load(yith_wcwl_l10n.ajax_url + ' .top-wishlist span', { action: 'yith_wcwl_update_single_product_list' });
});
});
if(window.jQuery){(function($){if((!$.support.opacity&&!$.support.style)){try{document.execCommand ("BackgroundImageCache",false,true);}catch(e){}}$.fn.rating=function(options){if(this.length==0){return this;}if(typeof arguments[0]=="string"){if(this.length>1){var args=arguments;return this.each(function(){$.fn.rating.apply($(this),args);});}$.fn.rating[arguments[0]].apply(this,$.makeArray(arguments).slice(1)||[]);return this;}var options=$.extend({},$.fn.rating.options,options||{});$.fn.rating.calls++;this.not(".star-rating-applied").addClass("star-rating-applied").each(function(){var control,input=$(this);var eid=(this.name||"unnamed-rating").replace(/\[|\]/g,"_").replace(/^\_+|\_+$/g,"");var context=$(this.form||document.body);var raters=context.data("rating");if(!raters||raters.call!=$.fn.rating.calls){raters={count:0,call:$.fn.rating.calls};}var rater=raters[eid]||context.data("rating"+eid);if(rater){control=rater.data("rating");}if(rater&&control){control.count++;}else{control=$.extend({},options||{},($.metadata?input.metadata():($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=raters.count++;rater=$('');input.before(rater);rater.addClass("rating-to-be-drawn");if(input.attr("disabled")||input.hasClass("disabled")){control.readOnly=true;}if(input.hasClass("required")){control.required=true;}rater.append(control.cancel=$('").on("mouseover",function(){$(this).rating("drain");$(this).addClass("star-rating-hover");}).on("mouseout",function(){$(this).rating("draw");$(this).removeClass("star-rating-hover");}).on("click",function(){$(this).rating("select");}).data("rating",control));}var star=$('");rater.append(star);if(this.id){star.attr("id",this.id);}if(this.className){star.addClass(this.className);}if(control.half){control.split=2;}if(typeof control.split=="number"&&control.split>0){var stw=($.fn.width?star.width():0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw/control.split);star.width(spw).find("a").css({"margin-left":"-"+(spi*spw)+"px"});}if(control.readOnly){star.addClass("star-rating-readonly");}else{star.addClass("star-rating-live").on("mouseover",function(){$(this).rating("fill");$(this).rating("focus");}).on("mouseout",function(){$(this).rating("draw");$(this).rating("blur");}).on("click",function(){$(this).rating("select");});}if(this.checked){control.current=star;}if(this.nodeName=="A"){if($(this).hasClass("selected")){control.current=star;}}input.hide();input.on("change.rating",function(event){if(event.selfTriggered){return false;}$(this).rating("select");});star.data("rating.input",input.data("rating.star",star));control.stars[control.stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rater=raters[eid]=rater;control.context=context;input.data("rating",control);rater.data("rating",control);star.data("rating",control);context.data("rating",raters);context.data("rating"+eid,rater);});$(".rating-to-be-drawn").rating("draw").removeClass("rating-to-be-drawn");return this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data("rating");if(!control){return this;}if(!control.focus){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.focus){control.focus.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},blur:function(){var control=this.data("rating");if(!control){return this;}if(!control.blur){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.blur){control.blur.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},fill:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}this.rating("drain");this.prevAll().addBack().filter(".rater-"+control.serial).addClass("star-rating-hover");},drain:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.rater.children().filter(".rater-"+control.serial).removeClass("star-rating-on").removeClass("star-rating-hover");},draw:function(){var control=this.data("rating");if(!control){return this;}this.rating("drain");var current=$(control.current);var starson=current.length?current.prevAll().addBack().filter(".rater-"+control.serial):null;if(starson){starson.addClass("star-rating-on");}control.cancel[control.readOnly||control.required?"hide":"show"]();this.siblings()[control.readOnly?"addClass":"removeClass"]("star-rating-readonly");},select:function(value,wantCallBack){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.current=null;if(typeof value!="undefined"||this.length>1){if(typeof value=="number"){return $(control.stars[value]).rating("select",undefined,wantCallBack);}if(typeof value=="string"){$.each(control.stars,function(){if($(this).data("rating.input").val()==value){$(this).rating("select",undefined,wantCallBack);}});return this;}}else{control.current=this[0].tagName=="INPUT"?this.data("rating.star"):(this.is(".rater-"+control.serial)?this:null);}this.data("rating",control);this.rating("draw");var current=$(control.current?control.current.data("rating.input"):null);var lastipt=$(control.inputs).filter(":checked");var deadipt=$(control.inputs).not(current);deadipt.prop("checked",false);current.prop("checked",true);$(current.length?current:lastipt).trigger({type:"change",selfTriggered:true});if((wantCallBack||wantCallBack==undefined)&&control.callback){control.callback.apply(current[0],[current.val(),$("a",control.current)[0]]);}return this;},readOnly:function(toggle,disable){var control=this.data("rating");if(!control){return this;}control.readOnly=toggle||toggle==undefined?true:false;if(disable){$(control.inputs).attr("disabled","disabled");}else{$(control.inputs).removeAttr("disabled");}this.data("rating",control);this.rating("draw");},disable:function(){this.rating("readOnly",true,true);},enable:function(){this.rating("readOnly",false,false);}});$.fn.rating.options={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16};$(function(){$("input[type=radio].star").rating();});})(jQuery);}(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
(function($){var feature={};feature.fileapi=$("").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;$.fn.ajaxSubmit=function(options){if(!this.length){log("ajaxSubmit: skipping submit process - no element selected");return this;}var method,action,url,$form=this;if(typeof options=="function"){options={success:options};}method=this.attr("method");action=this.attr("action");url=(typeof action==="string")?$.trim(action):"";url=url||window.location.href||"";if(url){url=(url.match(/^([^#]+)/)||[])[1];}options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},options);var veto={};this.trigger("form-pre-serialize",[this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log("ajaxSubmit: submit aborted via beforeSerialize callback");return this;}var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;}var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log("ajaxSubmit: submit aborted via beforeSubmit callback");return this;}this.trigger("form-submit-validate",[a,this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this;}var q=$.param(a,traditional);if(qx){q=(q?(q+"&"+qx):qx);}if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null;}else{options.data=q;}var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?"replaceWith":"html";$(options.target)[fn](data).each(oldSuccess,arguments);});}else{if(options.success){callbacks.push(options.success);}}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i0;var mp="multipart/form-data";var multipart=($form.attr("enctype")==mp||$form.attr("encoding")==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});}else{jqxhr=fileUploadIframe(a);}}else{if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a);}else{jqxhr=$.ajax(options);}}$form.removeData("jqxhr").data("jqxhr",jqxhr);for(var k=0;k');$io.css({position:"absolute",top:"-1000px",left:"-1000px"});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==="timeout"?"timeout":"aborted");log("aborting upload... "+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand ("Stop");}}catch(ignore){}$io.attr("src",s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status);}if(g){$.event.trigger("ajaxError",[xhr,s,e]);}if(s.complete){s.complete.call(s.context,xhr,e);}}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,s]);}if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+".x"]=form.clk_x;s.extraData[n+".y"]=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=frame.contentWindow?frame.contentWindow.document:frame.contentDocument?frame.contentDocument:frame.document;return doc;}var csrf_token=$("meta[name=csrf-token]").attr("content");var csrf_param=$("meta[name=csrf-param]").attr("content");if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr("target"),a=$form.attr("action");form.setAttribute("target",id);if(!method){form.setAttribute("method","POST");}if(a!=s.url){form.setAttribute("action",s.url);}if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});}if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}function checkState(){try{var state=getDoc(io).readyState;log("state="+state);if(state&&state.toLowerCase()=="uninitialized"){setTimeout(checkState,50);}}catch(e){log("Server abort: ",e," (",e.name,")");cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle);}timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty("name")&&s.extraData[n].hasOwnProperty("value")){extraInputs.push($('').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('').val(s.extraData[n]).appendTo(form)[0]);}}}}if(!s.iframeTarget){$io.appendTo("body");if(io.attachEvent){io.attachEvent("onload",cb);}else{io.addEventListener("load",cb,false);}}setTimeout(checkState,15);var submitFn=document.createElement("form").submit;submitFn.apply(form);}finally{form.setAttribute("action",a);if(t){form.setAttribute("target",t);}else{$form.removeAttr("target");}$(extraInputs).remove();}}if(s.forceSync){doSubmit();}else{setTimeout(doSubmit,10);}var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}try{doc=getDoc(io);}catch(ex){log("cannot access response document: ",ex);e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort("timeout");deferred.reject(xhr,"timeout");return;}else{if(e==SERVER_ABORT&&xhr){xhr.abort("server abort");deferred.reject(xhr,"error","server abort");return;}}if(!doc||doc.location.href==s.iframeSrc){if(!timedOut){return;}}if(io.detachEvent){io.detachEvent("onload",cb);}else{io.removeEventListener("load",cb,false);}var status="success",errMsg;try{if(timedOut){throw"timeout";}var isXml=s.dataType=="xml"||doc.XMLDocument||$.isXMLDoc(doc);log("isXml="+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log("requeing onLoad callback, DOM not available");setTimeout(cb,250);return;}}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType="xml";}xhr.getResponseHeader=function(header){var headers={"content-type":s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute("status"))||xhr.status;xhr.statusText=docRoot.getAttribute("statusText")||xhr.statusText;}var dt=(s.dataType||"").toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName("textarea")[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute("status"))||xhr.status;xhr.statusText=ta.getAttribute("statusText")||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName("pre")[0];var b=doc.getElementsByTagName("body")[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;}else{if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}}else{if(dt=="xml"&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);}}try{data=httpData(xhr,dt,s);}catch(e){status="parsererror";xhr.error=errMsg=(e||status);}}catch(e){log("error caught: ",e);status="error";xhr.error=errMsg=(e||status);}if(xhr.aborted){log("upload aborted");status=null;}if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?"success":"error";}if(status==="success"){if(s.success){s.success.call(s.context,data,"success",xhr);}deferred.resolve(xhr.responseText,"success",xhr);if(g){$.event.trigger("ajaxSuccess",[xhr,s]);}}else{if(status){if(errMsg===undefined){errMsg=xhr.statusText;}if(s.error){s.error.call(s.context,xhr,status,errMsg);}deferred.reject(xhr,"error",errMsg);if(g){$.event.trigger("ajaxError",[xhr,s,errMsg]);}}}if(g){$.event.trigger("ajaxComplete",[xhr,s]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(s.complete){s.complete.call(s.context,xhr,status);}callbackProcessed=true;if(s.timeout){clearTimeout(timeoutHandle);}setTimeout(function(){if(!s.iframeTarget){$io.remove();}xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return(doc&&doc.documentElement&&doc.documentElement.nodeName!="parsererror")?doc:null;};var parseJSON=$.parseJSON||function(s){return window["eval"]("("+s+")");};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){if($.error){$.error("parsererror");}}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}}return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log("DOM not ready, queuing ajaxForm");$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}if(options.delegation){$(document).off("submit.form-plugin",this.selector,doAjaxSubmit).off("click.form-plugin",this.selector,captureSubmittingElement).on("submit.form-plugin",this.selector,options,doAjaxSubmit).on("click.form-plugin",this.selector,options,captureSubmittingElement);return this;}return this.ajaxFormUnbind().bind("submit.form-plugin",options,doAjaxSubmit).bind("click.form-plugin",options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest("[type=submit]");if(t.length===0){return;}target=t[0];}var form=this;form.clk=target;if(target.type=="image"){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin");};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a;}var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}(";5(1W.1C)(8($){5((!$.1s.1V&&!$.1s.1U))2d{1j.1X(\"1T\",C,s)}1R(e){};$.o.4=8(j){5(3.u==0)9 3;5(M V[0]=='1m'){5(3.u>1){7 k=V;9 3.18(8(){$.o.4.K($(3),k)})};$.o.4[V[0]].K(3,$.27(V).26(1)||[]);9 3};7 j=$.1b({},$.o.4.1w,j||{});$.o.4.P++;3.1y('.l-4-1g').p('l-4-1g').18(8(){7 b,m=$(3);7 c=(3.2g||'28-4').1f(/\\[|\\]/g,'Y').1f(/^\\Y+|\\Y+$/g,'');7 d=$(3.2h||1j.1H);7 e=d.6('4');5(!e||e.1o!=$.o.4.P)e={E:0,1o:$.o.4.P};7 f=e[c]||d.6('4'+c);5(f)b=f.6('4');5(f&&b)b.E++;R{b=$.1b({},j||{},($.1d?m.1d():($.25?m.6():w))||{},{E:0,L:[],v:[]});b.z=e.E++;f=$('<1G 13=\"l-4-1I\"/>');m.1J(f);f.p('4-12-11-10');5(m.Z('G')||m.14('G'))b.n=s;5(m.14('1c'))b.1c=s;f.1r(b.D=$(''+b.1B+'').q('1e',8(){$(3).4('N');$(3).p('l-4-T')}).q('1h',8(){$(3).4('x');$(3).I('l-4-T')}).q('1i',8(){$(3).4('y')}).6('4',b))};7 g=$(''+3.1k+'');f.1r(g);5(3.X)g.Z('X',3.X);5(3.1x)g.p(3.1x);5(b.29)b.B=2;5(M b.B=='1l'&&b.B>0){7 h=($.o.15?g.15():0)||b.1n;7 i=(b.E%b.B),17=1K.1L(h/b.B);g.15(17).1M('a').1N({'1O-1P':'-'+(i*17)+'1Q'})};5(b.n)g.p('l-4-1p');R g.p('l-4-1S').q('1e',8(){$(3).4('1q');$(3).4('J')}).q('1h',8(){$(3).4('x');$(3).4('H')}).q('1i',8(){$(3).4('y')});5(3.S)b.r=g;5(3.1Y==\"A\"){5($(3).14('1Z'))b.r=g};m.1t();m.q('1u.4',8(a){5(a.1v)9 C;$(3).4('y')});g.6('4.m',m.6('4.l',g));b.L[b.L.u]=g[0];b.v[b.v.u]=m[0];b.t=e[c]=f;b.23=d;m.6('4',b);f.6('4',b);g.6('4',b);d.6('4',e);d.6('4'+c,f)});$('.4-12-11-10').4('x').I('4-12-11-10');9 3};$.1b($.o.4,{P:0,J:8(){7 a=3.6('4');5(!a)9 3;5(!a.J)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.J)a.J.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},H:8(){7 a=3.6('4');5(!a)9 3;5(!a.H)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.H)a.H.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},1q:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;3.4('N');3.1z().1A().O('.t-'+a.z).p('l-4-T')},N:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;a.t.2a().O('.t-'+a.z).I('l-4-q').I('l-4-T')},x:8(){7 a=3.6('4');5(!a)9 3;3.4('N');7 b=$(a.r);7 c=b.u?b.1z().1A().O('.t-'+a.z):w;5(c)c.p('l-4-q');a.D[a.n||a.1c?'1t':'2b']();3.2c()[a.n?'p':'I']('l-4-1p')},y:8(a,b){7 c=3.6('4');5(!c)9 3;5(c.n)9;c.r=w;5(M a!='F'||3.u>1){5(M a=='1l')9 $(c.L[a]).4('y',F,b);5(M a=='1m'){$.18(c.L,8(){5($(3).6('4.m').Q()==a)$(3).4('y',F,b)});9 3}}R{c.r=3[0].19=='1a'?3.6('4.l'):(3.2e('.t-'+c.z)?3:w)};3.6('4',c);3.4('x');7 d=$(c.r?c.r.6('4.m'):w);7 e=$(c.v).O(':S');7 f=$(c.v).1y(d);f.1D('S',C);d.1D('S',s);$(d.u?d:e).2f({1E:'1u',1v:s});5((b||b==F)&&c.1F)c.1F.K(d[0],[d.Q(),$('a',c.r)[0]]);9 3},n:8(a,b){7 c=3.6('4');5(!c)9 3;c.n=a||a==F?s:C;5(b)$(c.v).Z(\"G\",\"G\");R $(c.v).2i(\"G\");3.6('4',c);3.4('x')},2j:8(){3.4('n',s,s)},2k:8(){3.4('n',C,C)}});$.o.4.1w={D:'2l 2m',1B:'',B:0,1n:16};$(8(){$('m[1E=2n].l').4()})})(1C);",62,148,"|||this|rating|if|data|var|function|return||||||||||||star|input|readOnly|fn|addClass|on|current|true|rater|length|inputs|null|draw|select|serial||split|false|cancel|count|undefined|disabled|blur|removeClass|focus|apply|stars|typeof|drain|filter|calls|val|else|checked|hover|title|arguments|div|id|_|attr|drawn|be|to|class|hasClass|width||spw|each|tagName|INPUT|extend|required|metadata|mouseover|replace|applied|mouseout|click|document|value|number|string|starWidth|call|readonly|fill|append|support|hide|change|selfTriggered|options|className|not|prevAll|addBack|cancelValue|jQuery|prop|type|callback|span|body|control|before|Math|floor|find|css|margin|left|px|catch|live|BackgroundImageCache|style|opacity|window|execCommand|nodeName|selected|role|text|aria|context|label|meta|slice|makeArray|unnamed|half|children|show|siblings|try|is|trigger|name|form|removeAttr|disable|enable|Cancel|Rating|radio".split("|"),0,{}));